\(\int \sqrt {c x^2} (a+b x)^n \, dx\) [925]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 17, antiderivative size = 63 \[ \int \sqrt {c x^2} (a+b x)^n \, dx=-\frac {a \sqrt {c x^2} (a+b x)^{1+n}}{b^2 (1+n) x}+\frac {\sqrt {c x^2} (a+b x)^{2+n}}{b^2 (2+n) x} \]

[Out]

-a*(b*x+a)^(1+n)*(c*x^2)^(1/2)/b^2/(1+n)/x+(b*x+a)^(2+n)*(c*x^2)^(1/2)/b^2/(2+n)/x

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {15, 45} \[ \int \sqrt {c x^2} (a+b x)^n \, dx=\frac {\sqrt {c x^2} (a+b x)^{n+2}}{b^2 (n+2) x}-\frac {a \sqrt {c x^2} (a+b x)^{n+1}}{b^2 (n+1) x} \]

[In]

Int[Sqrt[c*x^2]*(a + b*x)^n,x]

[Out]

-((a*Sqrt[c*x^2]*(a + b*x)^(1 + n))/(b^2*(1 + n)*x)) + (Sqrt[c*x^2]*(a + b*x)^(2 + n))/(b^2*(2 + n)*x)

Rule 15

Int[(u_.)*((a_.)*(x_)^(n_))^(m_), x_Symbol] :> Dist[a^IntPart[m]*((a*x^n)^FracPart[m]/x^(n*FracPart[m])), Int[
u*x^(m*n), x], x] /; FreeQ[{a, m, n}, x] &&  !IntegerQ[m]

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rubi steps \begin{align*} \text {integral}& = \frac {\sqrt {c x^2} \int x (a+b x)^n \, dx}{x} \\ & = \frac {\sqrt {c x^2} \int \left (-\frac {a (a+b x)^n}{b}+\frac {(a+b x)^{1+n}}{b}\right ) \, dx}{x} \\ & = -\frac {a \sqrt {c x^2} (a+b x)^{1+n}}{b^2 (1+n) x}+\frac {\sqrt {c x^2} (a+b x)^{2+n}}{b^2 (2+n) x} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.70 \[ \int \sqrt {c x^2} (a+b x)^n \, dx=\frac {c x (a+b x)^{1+n} (-a+b (1+n) x)}{b^2 (1+n) (2+n) \sqrt {c x^2}} \]

[In]

Integrate[Sqrt[c*x^2]*(a + b*x)^n,x]

[Out]

(c*x*(a + b*x)^(1 + n)*(-a + b*(1 + n)*x))/(b^2*(1 + n)*(2 + n)*Sqrt[c*x^2])

Maple [A] (verified)

Time = 0.13 (sec) , antiderivative size = 46, normalized size of antiderivative = 0.73

method result size
gosper \(-\frac {\sqrt {c \,x^{2}}\, \left (b x +a \right )^{1+n} \left (-b n x -b x +a \right )}{b^{2} x \left (n^{2}+3 n +2\right )}\) \(46\)
risch \(-\frac {\sqrt {c \,x^{2}}\, \left (-b^{2} n \,x^{2}-a b n x -b^{2} x^{2}+a^{2}\right ) \left (b x +a \right )^{n}}{x \,b^{2} \left (2+n \right ) \left (1+n \right )}\) \(60\)

[In]

int((b*x+a)^n*(c*x^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/b^2/x*(c*x^2)^(1/2)*(b*x+a)^(1+n)/(n^2+3*n+2)*(-b*n*x-b*x+a)

Fricas [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.00 \[ \int \sqrt {c x^2} (a+b x)^n \, dx=\frac {{\left (a b n x + {\left (b^{2} n + b^{2}\right )} x^{2} - a^{2}\right )} \sqrt {c x^{2}} {\left (b x + a\right )}^{n}}{{\left (b^{2} n^{2} + 3 \, b^{2} n + 2 \, b^{2}\right )} x} \]

[In]

integrate((b*x+a)^n*(c*x^2)^(1/2),x, algorithm="fricas")

[Out]

(a*b*n*x + (b^2*n + b^2)*x^2 - a^2)*sqrt(c*x^2)*(b*x + a)^n/((b^2*n^2 + 3*b^2*n + 2*b^2)*x)

Sympy [F]

\[ \int \sqrt {c x^2} (a+b x)^n \, dx=\begin {cases} \frac {a^{n} x \sqrt {c x^{2}}}{2} & \text {for}\: b = 0 \\\int \frac {\sqrt {c x^{2}}}{\left (a + b x\right )^{2}}\, dx & \text {for}\: n = -2 \\\int \frac {\sqrt {c x^{2}}}{a + b x}\, dx & \text {for}\: n = -1 \\- \frac {a^{2} \sqrt {c x^{2}} \left (a + b x\right )^{n}}{b^{2} n^{2} x + 3 b^{2} n x + 2 b^{2} x} + \frac {a b n x \sqrt {c x^{2}} \left (a + b x\right )^{n}}{b^{2} n^{2} x + 3 b^{2} n x + 2 b^{2} x} + \frac {b^{2} n x^{2} \sqrt {c x^{2}} \left (a + b x\right )^{n}}{b^{2} n^{2} x + 3 b^{2} n x + 2 b^{2} x} + \frac {b^{2} x^{2} \sqrt {c x^{2}} \left (a + b x\right )^{n}}{b^{2} n^{2} x + 3 b^{2} n x + 2 b^{2} x} & \text {otherwise} \end {cases} \]

[In]

integrate((b*x+a)**n*(c*x**2)**(1/2),x)

[Out]

Piecewise((a**n*x*sqrt(c*x**2)/2, Eq(b, 0)), (Integral(sqrt(c*x**2)/(a + b*x)**2, x), Eq(n, -2)), (Integral(sq
rt(c*x**2)/(a + b*x), x), Eq(n, -1)), (-a**2*sqrt(c*x**2)*(a + b*x)**n/(b**2*n**2*x + 3*b**2*n*x + 2*b**2*x) +
 a*b*n*x*sqrt(c*x**2)*(a + b*x)**n/(b**2*n**2*x + 3*b**2*n*x + 2*b**2*x) + b**2*n*x**2*sqrt(c*x**2)*(a + b*x)*
*n/(b**2*n**2*x + 3*b**2*n*x + 2*b**2*x) + b**2*x**2*sqrt(c*x**2)*(a + b*x)**n/(b**2*n**2*x + 3*b**2*n*x + 2*b
**2*x), True))

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 51, normalized size of antiderivative = 0.81 \[ \int \sqrt {c x^2} (a+b x)^n \, dx=\frac {{\left (b^{2} \sqrt {c} {\left (n + 1\right )} x^{2} + a b \sqrt {c} n x - a^{2} \sqrt {c}\right )} {\left (b x + a\right )}^{n}}{{\left (n^{2} + 3 \, n + 2\right )} b^{2}} \]

[In]

integrate((b*x+a)^n*(c*x^2)^(1/2),x, algorithm="maxima")

[Out]

(b^2*sqrt(c)*(n + 1)*x^2 + a*b*sqrt(c)*n*x - a^2*sqrt(c))*(b*x + a)^n/((n^2 + 3*n + 2)*b^2)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 119 vs. \(2 (59) = 118\).

Time = 0.31 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.89 \[ \int \sqrt {c x^2} (a+b x)^n \, dx={\left (\frac {a^{2} a^{n} \mathrm {sgn}\left (x\right )}{b^{2} n^{2} + 3 \, b^{2} n + 2 \, b^{2}} + \frac {{\left (b x + a\right )}^{n} b^{2} n x^{2} \mathrm {sgn}\left (x\right ) + {\left (b x + a\right )}^{n} a b n x \mathrm {sgn}\left (x\right ) + {\left (b x + a\right )}^{n} b^{2} x^{2} \mathrm {sgn}\left (x\right ) - {\left (b x + a\right )}^{n} a^{2} \mathrm {sgn}\left (x\right )}{b^{2} n^{2} + 3 \, b^{2} n + 2 \, b^{2}}\right )} \sqrt {c} \]

[In]

integrate((b*x+a)^n*(c*x^2)^(1/2),x, algorithm="giac")

[Out]

(a^2*a^n*sgn(x)/(b^2*n^2 + 3*b^2*n + 2*b^2) + ((b*x + a)^n*b^2*n*x^2*sgn(x) + (b*x + a)^n*a*b*n*x*sgn(x) + (b*
x + a)^n*b^2*x^2*sgn(x) - (b*x + a)^n*a^2*sgn(x))/(b^2*n^2 + 3*b^2*n + 2*b^2))*sqrt(c)

Mupad [B] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.35 \[ \int \sqrt {c x^2} (a+b x)^n \, dx=\frac {{\left (a+b\,x\right )}^n\,\left (\frac {x^2\,\sqrt {c\,x^2}\,\left (n+1\right )}{n^2+3\,n+2}-\frac {a^2\,\sqrt {c\,x^2}}{b^2\,\left (n^2+3\,n+2\right )}+\frac {a\,n\,x\,\sqrt {c\,x^2}}{b\,\left (n^2+3\,n+2\right )}\right )}{x} \]

[In]

int((c*x^2)^(1/2)*(a + b*x)^n,x)

[Out]

((a + b*x)^n*((x^2*(c*x^2)^(1/2)*(n + 1))/(3*n + n^2 + 2) - (a^2*(c*x^2)^(1/2))/(b^2*(3*n + n^2 + 2)) + (a*n*x
*(c*x^2)^(1/2))/(b*(3*n + n^2 + 2))))/x